import React, { Suspense } from "react"
import { Navigate } from "react-router-dom"
let Zin = React.lazy(() => import("../view/zin"))
let Index = React.lazy(() => import("../view/index"))
let Information = React.lazy(() => import("../view/information"))
let MyPI = React.lazy(() => import("../view/myPI"))
let PublishProduct = React.lazy(() => import("../view/publishProduct"))
let MyOrder = React.lazy(() => import("../view/myOrder"))
let Register = React.lazy(() => import("../view/register"))
let ProductDetails = React.lazy(() => import("../view/productDetails"))
let RetrievePassword = React.lazy(() => import("../view/retrievePassword"))
let SearchShoop = React.lazy(() => import("../view/searchShoop"))
let Payment = React.lazy(() => import("../view/payment"))
let Shop = React.lazy(() => import("../view/shop"))
let FBSubmit = React.lazy(() => import("../view/fBSubmit"))
let FBSearchType=React.lazy(() => import("../view/fBSearchType"))
let FBType=React.lazy(() => import("../view/fBType"))
let MyCollect=React.lazy(() => import("../view/myCollect"))
let BrowsingHistory=React.lazy(() => import("../view/browsingHistory"))
let MyRelease=React.lazy(() => import("../view/myRelease"))
let Login=React.lazy(() => import("../view/login"))
let ZinLT=React.lazy(() => import("../view/zinLT"))
let Personal=React.lazy(() => import("../view/personal"))
const routerData = [
    {
        path: "/zin",
        element: <Zin></Zin>,
        children: [
            {
                path: "index", //首页 (赵新培)
                element: <Suspense fallback={<>页面加载中....</>}><Index></Index></Suspense>
            },
            {
                path: "information", //消息页面 (王家壮)
                element: <Suspense fallback={<>页面加载中....</>}><Information></Information></Suspense>
            },
            {
                path: "myPI", //个人详情页面 (姜存旺)
                element: <Suspense fallback={<>页面加载中....</>}><MyPI></MyPI></Suspense>
            },
            {
                path: "publishProduct", //发布页面 (赵志勇)
                element: <Suspense fallback={<>页面加载中....</>}><PublishProduct></PublishProduct></Suspense>
            }

        ]

    },
    // 重定向
    {
        path: "/",
        element: <Navigate to='/Zin/information'></Navigate>
    },
    {
        path: "/login",
        element: <Suspense fallback={<>页面加载中....</>}><Login></Login></Suspense>
    },
    //我的订单路由 (姜存旺)
    {
        path: "/myOrder/:status",
        element: <Suspense fallback={<>页面加载中....</>}><MyOrder></MyOrder></Suspense>
    },
    {
        path:"/personal",
        element:<Suspense fallback={<>页面加载中....</>}><Personal></Personal></Suspense>
    },
    // 注册路由 (庞永志)
    {
        path: "/register",
        element: <Suspense fallback={<>页面加载中....</>}> <Register></Register></Suspense>
    },
    {
        // 商品详情页 (赵新培)
        path: "/productDetails",
        element: <Suspense fallback={<>页面加载中....</>}><ProductDetails></ProductDetails></Suspense>
    },
    // 找回密码 (庞永志)
    {
        path: "/retrievePassword",
        element: <Suspense fallback={<>页面加载中....</>}><RetrievePassword></RetrievePassword></Suspense>
    },
    //搜索商品页(赵新培)
    {
        path: "/searchShoop",
        element: <Suspense fallback={<>页面加载中....</>}><SearchShoop></SearchShoop></Suspense>
    },
    // 支付页面(赵新培)
    {
        path: "/payment",
        element: <Suspense fallback={<>页面加载中....</>}><Payment></Payment></Suspense>
    },
    // 店铺(赵新培)
    {
        path:"/shop",
        element:<Suspense fallback={<>页面加载中....</>}><Shop></Shop></Suspense>
    },
    // 发布搜索类型(赵志勇)
    {
        path:"/fBSearchType",
        element:<Suspense fallback={<>页面加载中....</>}><FBSearchType></FBSearchType></Suspense>
    },
    // 发布提交页(赵志勇)
    {
        path:"/fBSubmit",
        element:<Suspense fallback={<>页面加载中....</>}><FBSubmit></FBSubmit></Suspense>
    },
    // 发布类型展示页 （赵志勇）
    { 
        path:"/fBType",
        element:<Suspense fallback={<>页面加载中....</>}><FBType></FBType></Suspense>
    },
    // 我的收藏展示页（姜存旺）
    {
        path:"/myCollect",
        element:<Suspense fallback={<>页面加载中....</>}><MyCollect></MyCollect></Suspense>
    },
    // 我的浏览记录展示页 （姜存旺）
    {
        path:"/browsingHistory",
        element:<Suspense fallback={<>页面加载中....</>}><BrowsingHistory></BrowsingHistory></Suspense>
    },
    //我的发布列表页 （姜存旺）
    {
        path:"/myRelease/:status",
        element:<Suspense fallback={<>页面加载中....</>}><MyRelease></MyRelease></Suspense>
    },
    {
        path:"/zinLT",
        element:<Suspense fallback={<>页面加载中....</>}><ZinLT></ZinLT></Suspense>
    },

    
]
export default routerData